#include <stdio.h>

int main(int argc, char *argv[]) {

    int x, y = 0;
    scanf("%d %d", &x, &y);
    int sum = 0;
    for (size_t i = x; i <= y; i++)
    {
        if(i%3==1&&i%5==3)
            sum += i;
    }
    printf("%d", sum);

    return 0;
}